package com.leetcode.partition6;

/**
 * @author `RKC`
 * @date 2022/2/14 18:36
 */
public class LC540有序数组中的单一元素 {

    public int singleNonDuplicate(int[] nums) {
        int ans = nums[0];
        for (int i = 1; i < nums.length; i++) ans ^= nums[i];
        return ans;
    }
}
